
#ifndef CONTECTBIT_CONTACT_H
#define CONTECTBIT_CONTACT_H

#endif //CONTECTBIT_CONTACT_H

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

//#define MAX 100  注释改动态分配内存
#define MAX_NAME 20
#define MAX_SEX 5
#define MAX_TELEPHONE 12
#define MAX_ADDRESS 20
#define DEFAULT_SIZE 3

typedef struct People {
    char name[MAX_NAME];
    int age;
    char sex[MAX_SEX];
    char telephone[MAX_TELEPHONE];
    char address[MAX_ADDRESS];
}people;

typedef struct {
    people* PeoInformation;
    int size;
    int capacity;   //当前容量
}Contact;

enum OPTION{
    EXIT,    //0
    ADD,
    DEL,
    SEARCH,
    MODIFY,
    SHOW,
    SORT,
    SAVE
};

void Add_people(Contact* contact);   //增加元素
void menu();
void Init_Contact(Contact* contact);   //初始化
void Del_people(Contact* contact);     //删除元素
void Show_numbers(Contact* contact);   //打印成员
void Search_numbers(const Contact* contact);
void Modify_information(Contact* contact);
void Destroy_contact(Contact* contact);
void Sort_people(Contact* contact);
void Save_contact(Contact* contact);